/**
 * @Title: settle_router.js
 * @Description: 结算指标router
 * Copyright: Copyright (c) 2014 
 * Company:中国平安
 *
 * @Project HIMS-FWA
 * @author QIANDUO875
 * @date 2014年9月25日 下午2:01:05
 * @version V1.0
 */
;
(function(){
	'use strict';
	
	var app = angular.module('mhis.configs');
	app.config(['BaseURL','Config', function(baseUrl,Config){
		
		var states = Config.states;
		
		/**
		 * 结算管理路由开始
		 */
		states.push({
			name:'settleAnalyseHome',
			url:'/settleAnalyseHome',
			data:{
	        	title:'结算分析',
	        	tabRoot:'settleAnalyseHome'
	        },
	        deepStateRedirect: true,
	        sticky: true,
	        views:{
	        	'settleAnalyseHome@':{
	        		templateUrl:baseUrl+'views/hcpms/achievements/settlement/general_view.html',
	        		controller:'IDeskDataCtrl'
	        	}
	        }
		});
		
		/**
		 * 首页
		 
		states.push({
			name:'settleAnalyseHome.general',
			url:'/general',
			data:{
	        	title:'结算分析',
	        	tabRoot:'settleAnalyseHome'
	        },
	        views:{
	        	'@settleAnalyseHome':{
	        		templateUrl:baseUrl+'views/achievements/settlement/general_view.html',
	        		controller:'IDeskDataCtrl'
	        	}
	        }
		});*/
		
		/**
		 * 费用分布(原始)-- 陈永宏
		 */
		states.push({
			name:'costCover',
	        url:'/costCover',
	        data:{
	        	title:'费用分布',
	        	tabRoot:'costCover'
	        },
	        deepStateRedirect: true,
	        sticky: true,
	        views:{
	            'costCover@':{
	            	template:'<div ui-view class="full-width full-height"></div>',
	            	controller:function($state) {
	            		if($state.current.name === 'costCover') {
	            			$state.go('costCover.situation', {
	            				date: ''
	            			});
	            			return;
	            		}
	            	}
	            }
	        }
		});
		
		states.push({
			name:'costCover.situation',
	        url:'/situation/{date}',
	        data:{
	        	title:'费用分布',
	        	tabRoot:'costCover'
	        },
	        views:{
	            '@costCover':{
	            	templateUrl:baseUrl+'views/hcpms/achievements/settlement/costCover.html',
	            	controller:'CostCoverCtrl'
	            }
	        }
		});
		
		/**
		 * 费用执行情况 mys
		 */
		states.push({
			name:'feeView',
	        url:'/feeView',
	        data:{
	        	title:'费用执行情况',
	        	tabRoot:'feeView'
	        },
	        deepStateRedirect: true,
	        sticky: true,
	        views:{
	            'feeView@':{
	            	template:'<div ui-view class="full-width full-height"></div>',
	            	controller:function($state) {
	            		if($state.current.name === 'feeView') {
	            			$state.go('feeView.detail', {
	            				indicator: '',
	            				hospType: '',
	            				year: '',
	            				month: ''
	            			});
	            			return;
	            		}
	            	}
	            }
	        }
		});
		
		states.push({
			name:'feeView.detail',
	        url:'/detail/:indicator/{hospType}/{date}',
	        data:{
	        	title:'费用执行情况',
	        	tabRoot:'feeView'
	        },
	        views:{
	            '@feeView':{
	            	templateUrl:baseUrl+'views/hcpms/achievements/settlement/fee_view.html',
	            	controller:'FeeViewCtrl'
	            }
	        }
		});
		
		
		/**
		 * 指标配置  xieqi
		 */
		states.push({
            name:'indicators',
            url:'/indicators',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'指标配置',
                tabRoot:'indicators'
            },
            views:{
                'indicators@':{
                    templateUrl:baseUrl +'views/hcpms/quota/indicatorConfig/indicatorsConfiguration_view.html',
                    controller:'IndicatorsConfigurationCtrl'
                }
            }
        });
        states.push({
            name:'indicators.indicatorsInfo',
            url:'/indicatorsInfo/{kpiId}/{regionCode}',
            data:{
                title:'指标配置',
                tabRoot:'indicators'
            },
            views:{
                '@indicators':{
                    templateUrl:baseUrl+'/views/hcpms/quota/indicatorConfig/indicators_view.html',
                    controller:'IndicatorsInfoCtrl'
                }
            }
        });
        states.push({
            name:'indicators.fwaIndicatorsInfo',
            url:'/fwaIndicatorsInfo/:code',
            data:{
                title:'指标配置',
                tabRoot:'indicators'
            },
            views:{
                '@indicators':{
                    templateUrl:baseUrl+'/views/hcpms/quota/indicatorConfig/fwaIndicators_view.html',
                    controller:'FwaIndicatorsCtrl'
                }
            }
        });

		
		
		
		/**
		 * 指标分析器 qianduo
		 */
		states.push({
			name:'settleAnalyse',
			url:'/settleAnalyse/{indicator}/{view}/{startDate}/{endDate}',
			data:{
	        	title:'指标分析器',
	        	tabRoot:'settleAnalyse'
	        },
	        deepStateRedirect: true,
	        sticky: true,
	        views:{
	        	'settleAnalyse@':{
	        		templateUrl:baseUrl+'views/hcpms/achievements/settlement/kpiAnalyse/settleAnalyseMain_view.html',
	        		controller:'SettleAnalyseMainCtrl'
	        	}
	        }
		});
		
		var chartsConfig = {
    		templateUrl:function($stateParams){
    			var indicator = $stateParams.indicator;
    			return baseUrl+'views/hcpms/achievements/settlement/kpiAnalyse/indicators/'+indicator+'_view.html'
    		},
    		controllerProvider:function($stateParams){
    			var indicator = $stateParams.indicator;
    			return indicator.substring(0,1).toUpperCase() + indicator.substring(1,indicator.length) + 'Ctrl';
    		}
    	};
		
		//指标分析器-区域视图
		states.push({
			name:'settleAnalyse.regionView',
			url:'/regionView',
			data:{
	        	title:'指标分析器',
	        	tabRoot:'settleAnalyse'
	        },
	        views:{
	        	'@settleAnalyse':{
	        		controller:'SettleAnalyseRegionCtrl',
	        		templateUrl:baseUrl+'views/hcpms/achievements/settlement/kpiAnalyse/settleAnalyseRegion_view.html'
	        	},
	        	'charts@settleAnalyse':chartsConfig
	        }
		});
		
		//指标分析器-机构视图
		states.push({
			name:'settleAnalyse.orgView',
			url:'/orgView/{id}/d/{dept}',
			data:{
	        	title:'指标分析器',
	        	tabRoot:'settleAnalyse'
	        },
	        views:{
	        	'@settleAnalyse':{
	        		templateUrl:baseUrl+'views/hcpms/achievements/settlement/kpiAnalyse/settleAnalyseOrg_view.html',
	        		controller:'SettleAnalyseOrgCtrl'
	        	},
	        	'charts@settleAnalyse':chartsConfig
	        }
		});
		
		//指标分析器-科室视图
		states.push({
			name:'settleAnalyse.departView',
			url:'/departView/{id}/d/{doctor}/{orgCode}',
			data:{
	        	title:'指标分析器',
	        	tabRoot:'settleAnalyse'
	        },
	        views:{
	        	'@settleAnalyse':{
	        		templateUrl:baseUrl+'views/hcpms/achievements/settlement/kpiAnalyse/settleAnalyseDepart_view.html',
	        		controller:'SettleAnalyseDepartCtrl'
	        	},
	        	'charts@settleAnalyse':chartsConfig
	        }
		});
		
		//预警分析
		states.push({
			name:'warningAnalysis',
			url:'/warningAnalysis',
			data:{
	        	title:'预警分析',
	        	tabRoot:'warningAnalysis'
	        },
	        deepStateRedirect: true,
	        sticky: true,
	        views:{
	        	'warningAnalysis@':{
	        		templateUrl:baseUrl+'views/hcpms/achievements/warning/warningAnalysis_view.html',
	        		controller:'WarningAnalysisCtrl'
	        	}
	        }
		});
		
		//----------------------------------------------------------------------------
		/**
		 * 诚信管理  医务人员详情查询--longyin
		 */
		states.push({
            name:'integrityDetail',
            url:'/integrityDetail',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'医务人员详情查询',
                tabRoot:'integrityDetail'
            },
            views:{
                'integrityDetail@':{
                  templateUrl:baseUrl +'views/hcpms/achievements/integrity/insuredMedicalDetail_view.html',
                    controller:'IntegrityMedicalDetailCtrl'
                }
            }
        });
		//----------------------------------------------------------------------------
		/**
		 * 诚信管理  医务人员诚信登记
		 */
		states.push({
            name:'integrityQueryAdd',
            url:'/integrityQueryAdd',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityQueryAdd'
            },
            views:{
                'integrityQueryAdd@':{
                  templateUrl:baseUrl +'views/hcpms/achievements/integrity/insuredMedicalListAdd_view.html',
                    controller:'IntegrityMedicalListAddCtrl'
                }
            }
        });
		/**
		 * 诚信管理  医务人员诚信管理 xieyuwen
		 */
		states.push({
            name:'integrityMedical',
            url:'/integrityMedical',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedical'
            },
            views:{
                'integrityMedical@':{
                    template:'<div class="full-width full-height" ui-view></div>',
                    controller:function ($state) {
                    	if ($state.current.name == 'integrityMedical') {
                    		$state.go("integrityMedical.integrityList",{
                    			startDate : '',
                    			endDate : ''
                    		});
                    	}
                    }
                }
            }
        });
		
		states.push({
            name:'integrityMedical.integrityList',
            url:'/integrityList/{startDate}/{endDate}',
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedical'
            },
            views:{
                '@integrityMedical':{
                    templateUrl:baseUrl +'views/hcpms/achievements/integrity/integrityMedical_view.html',
                    controller:'IntegrityMedicalCtrl'
                }
            }
        });
		states.push({
            name:'integrityMedicalDesc',
            url:'/integrityMedicalDesc',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedicalDesc'
            }
        });
		states.push({
            name:'integrityMedicalDesc.info',
            url:'/info/{doctorCode}/{doctorName}/{certificateNo}/{startDate}/{endDate}',
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedicalDesc'
            },
            views:{
                'integrityMedicalDesc@':{
                    templateUrl:baseUrl +'views/hcpms/achievements/integrity/integrityMedicalDesc_view.html',
                    controller:'IntegrityMedicalDescCtrl'
                }
            }
        });
		states.push({
            name:'integrityMedicalMark',
            url:'/integrityMedicalMark',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedicalMark'
            }
        });
		states.push({
            name:'integrityMedicalMark.info',
            url:'/info/{flat}/{orgCode}/{doctorName}/{certificateNo}/{orgName}/{fullAddress}/{startDate}/{endDate}/{doctorCode}',
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedicalMark'
            },
            views:{
                'integrityMedicalMark@':{
                    templateUrl:baseUrl +'views/hcpms/achievements/integrity/integrityMedicalMark_view.html',
                    controller:'IntegrityMedicalMarkCtrl'
                }
            }
        });
        
		states.push({
            name:'integrityMedicalTotal',
            url:'/integrityMedicalTotal',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedicalTotal'
            }
        });
		states.push({
            name:'integrityMedicalTotal.info',
            url:'/info/{doctorCode}/{startDate}/{endDate}',
            data:{
                title:'医务人员诚信管理',
                tabRoot:'integrityMedicalTotal'
            },
            views:{
                'integrityMedicalTotal@':{
                    templateUrl:baseUrl +'views/hcpms/achievements/integrity/integrityMedicalTotal_view.html',
                    controller:'IntegrityMedicalTotalCtrl'
                }
            }
        });
		
        /**
		 * 诚信管理  参保人黑名单管理 
		 */
		states.push({
            name:'insuredBlacklist',
            url:'/insuredBlacklist',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'参保人诚信管理',
                tabRoot:'insuredBlacklist'
            },
            views:{
                'insuredBlacklist@':{
                	template:'<div class="full-width full-height" ui-view></div>',
                    controller:function ($state) {
                    	if ($state.current.name == 'insuredBlacklist') {
                    		$state.go("insuredBlacklist.insuredList",{
                    			startDate : '',
                    			endDate : ''
                    		});
                    	}
                    }
                }
            }
        });
		
		states.push({
            name:'insuredBlacklist.insuredList',
            url:'/insuredBlacklist/{startDate}/{endDate}',
            data:{
                title:'参保人诚信管理',
                tabRoot:'insuredBlacklist'
            },
            views:{
                '@insuredBlacklist':{
                    templateUrl:baseUrl +'views/hcpms/achievements/integrity/insuredBlacklistQuery_view.html',
                    controller:'InsuredBlackListQueryCtrl'
                }
            }
        });
		//*********************参保人诚信管理2（用来查询start）*******************************
		states.push({
            name:'insuredBlacklistFind',
            url:'/insuredBlacklistFind',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'参保人诚信管理',
                tabRoot:'insuredBlacklistFind'
            },
            views:{
                'insuredBlacklistFind@':{
                	template:'<div class="full-width full-height" ui-view></div>',
                    controller:function ($state) {
                    	if ($state.current.name == 'insuredBlacklistFind') {
                    		$state.go("insuredBlacklistFind.insuredListFind",{
                    			startDate : '',
                    			endDate : ''
                    		});
                    	}
                    }
                }
            }
        });
		
		states.push({
            name:'insuredBlacklistFind.insuredListFind',
            url:'/insuredBlacklistFind/{startDate}/{endDate}',
            data:{
                title:'参保人诚信管理',
                tabRoot:'insuredBlacklistFind'
            },
            views:{
                '@insuredBlacklistFind':{
                    templateUrl:baseUrl +'views/hcpms/achievements/integrity/insuredBlacklistQuery_viewTwo.html',
                    controller:'insuredBlacklistQueryTwo_ctrl'
                }
            }
        });
		//*******************************End*******************************
		
		
		//*********************参保人诚信管理审核岗位（用来查询start）*******************************
		states.push({
            name:'insuredBlacklistAudit',
            url:'/insuredBlacklistAudit',
            deepStateRedirect: true,
            sticky: true,
            data:{
                title:'参保人诚信管理',
                tabRoot:'insuredBlacklistAudit'
            },
            views:{
                'insuredBlacklistAudit@':{
                	template:'<div class="full-width full-height" ui-view></div>',
                    controller:function ($state) {
                    	if ($state.current.name == 'insuredBlacklistAudit') {
                    		$state.go("insuredBlacklistAudit.insuredListAudit",{
                    			startDate : '',
                    			endDate : ''
                    		});
                    	}
                    }
                }
            }
        });
		
		states.push({
            name:'insuredBlacklistAudit.insuredListAudit',
            url:'/insuredListAudit/{startDate}/{endDate}',
            data:{
                title:'参保人诚信管理',
                tabRoot:'insuredBlacklistAudit'
            },
            views:{
                '@insuredBlacklistAudit':{
                    templateUrl:baseUrl +'views/hcpms/achievements/integrity/insuredBlacklistAudit_view.html',
                    controller:'InsuredBlackListAuditCtrl'
                }
            }
        });
		//*******************************End*******************************
		
	}]);
	
})();